<script>
export default {
	onLaunch: function() {
		uni.hideTabBar();
		let _self = this;
		// #ifdef APP-PLUS
		plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
			let vesion = parseInt(wgtinfo.version.split('.').join(''));
			_self.$store.commit('setVersion', vesion);
		});

		try {
			this.$http.httpRequest('sysParameter/app', null, false).then(res => {
				//console.log('sysParameter/app',res)
				if (res._tranStatus) {
					_self.$store.commit('setAPIUrl', res._data.map.app_url);
					_self.$store.commit('setAPIVersion', res._data.map.version_manage);
					_self.$store.commit('setCheckMode', res._data.map.online_switch);
				}
			});
		} catch (e) {
			//console.log('bannerList', e);
		}
		// #endif
	},
	onShow: function() {
		let _self = this;
		_self.$util.loseSession();
		/* 检测剪切板是否有内容 */
		// #ifdef APP-PLUS
		uni.getClipboardData({
			success: function(res) {
				let data = res.data;
				//console.log('检查剪切板内容', data, data.length > 0);
				if (data && data.length > 0) {
					//为app的邀请码信息
					if (data.indexOf('$$') > -1 || _self.$util.isNumber(data)) {
						_self.$store.commit('hideSearchDialog');
					} else {
						_self.$store.commit('showSearchDialog', data);
					}
				} else {
					_self.$store.commit('hideSearchDialog');
				}
			}
		});
		// #endif
	},
	onHide: function() {
		this.$store.commit('hideSearchDialog');
	}
};
</script>

<style>
@import url('common/main.css');
</style>
